package com.gome.ocean.dao.model.authority;

import org.apache.commons.lang3.StringUtils;

import com.gome.framework.base.BaseBO;
import com.gome.ocean.common.constants.Constants;

/**
 * @作者 haqiaolong
 * @创建时间 2016-01-22 16:59:38
 * @版本 1.00
 * @修改记录
 */
public class ProjectBO extends BaseBO {

    /**
     * 
     */
    private static final long serialVersionUID = 2433311674752473231L;
    /** 项目名称 */
    private String            projectName;
    /** 项目所属用户 */
    private String            projectUser;
    /** 项目用户邮件 */
    private String            projectEmail;
    /** 项目用户电话 */
    private String            projectPhone;

    public ProjectBO(){
    };

    public ProjectBO(String projectName, String projectUser, String projectEmail, String projectPhone){
        this.projectName = projectName;
        this.projectUser = projectUser;
        this.projectEmail = projectEmail;
        this.projectPhone = projectPhone;
    }

    public String getProjectName() {
        return this.projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public String getProjectUser() {
        return this.projectUser;
    }

    public void setProjectUser(String projectUser) {
        this.projectUser = projectUser;
    }

    /**
     * 是否包含某个用户
     * 
     * @param userEmail
     * @return
     */
    public boolean hasUser(String userEmail) {
        if (StringUtils.isBlank(projectUser)) {
            return false;
        }
        String[] userEmails = projectUser.split(Constants.REG_CN_OR_EN_COMMA);
        for (String email : userEmails) {
            if (email.equals(userEmail)) {
                return true;
            }
        }
        return false;
    }

    public String getProjectEmail() {
        return this.projectEmail;
    }

    public void setProjectEmail(String projectEmail) {
        this.projectEmail = projectEmail;
    }

    public String getProjectPhone() {
        return this.projectPhone;
    }

    public void setProjectPhone(String projectPhone) {
        this.projectPhone = projectPhone;
    }

}
